Source data: https://covidtracking.com/, which updates daily at 4 PM ET.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
Note that total cases are plotted on a log scale.
The 5-day rolling average is plotted.
This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Total reported COVID tests per day.
Positive test rate is the percentage of total reported tests each day that are positive.
---
title: "COVID Case Plots"
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
source_code: embed
---
Source data: , which updates daily at 4 PM ET.
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE
)
library(tidyverse)
library(jsonlite)
library(lubridate)
library(httr)
library(scales)
library(plotly)
library(flexdashboard)
```
```{r importData, echo = FALSE}
COVID_states <- fromJSON("https://covidtracking.com/api/v1/states/daily.json")
COVID_states$date <- ymd(COVID_states$date)
COVID_states <- COVID_states %>%
arrange(date)
COVID_US <- fromJSON("https://covidtracking.com/api/v1/us/daily.json")
COVID_US$date <- ymd(COVID_US$date)
COVID_US <- COVID_US %>%
arrange(date)
```
```{r UScalcs, echo = FALSE}
COVID_US <- COVID_US %>%
mutate(dailyPositives = c(NA, diff(positive)))
# calculate 5-day averaged new cases
COVID_US <- COVID_US %>%
mutate(avgDailyPositives =
(lag(dailyPositives, n = 2) +
lag(dailyPositives, n = 1) +
dailyPositives +
lead(dailyPositives, n = 1) +
lead(dailyPositives, n = 2)) / 5)
# calculate growth rate from 5-day averaged new cases
COVID_US <- COVID_US %>%
mutate(growthRate = avgDailyPositives/lag(avgDailyPositives))
# calculate daily % change in average daily increase
COVID_US <- COVID_US %>%
mutate(percentChange = 100 * avgDailyPositives / positive)
# calculate % of total daily tests that were positive
COVID_US <- COVID_US %>%
mutate(percentPositive = 100 * positiveIncrease / totalTestResultsIncrease)
```
US
=================================================
Row
---------------------------------------------------
### Cumulative Cases
```{r UStotal, echo=FALSE}
US_total_plot <- ggplot(COVID_US,
aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 10 * max(COVID_US$positive)),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
US_plotly_total <- ggplotly(p = (US_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
US_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r USdaily, echo=FALSE}
# average new daily cases
US_new_daily_plot <- ggplot(COVID_US,
aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 42000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
US_plotly_new_daily <- ggplotly(
p = (US_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
US_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r USdailyGrowth, echo=FALSE}
US_growth_rate_plot <- ggplot(COVID_US,
aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(limits = c(0, 3.1),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
US_growth_plotly <- ggplotly(
p = (US_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
US_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r USpercentChange, echo=FALSE}
# average daily percent change
US_daily_percent <- COVID_US %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
USpercentPlot <- ggplotly(
p = (
US_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
USpercentPlot
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r USdailyTest, echo=FALSE}
US_test_daily_plot <- ggplot(COVID_US,
aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 350000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
US_plotly_tests_daily <- ggplotly(
p = (US_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
US_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r USpercentTest, echo=FALSE}
US_test_percent <- COVID_US %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
USpercentTestPlot <- ggplotly(
p = (
US_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
USpercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
```{r stateDataCalcs, message=FALSE, warning=FALSE, include=FALSE}
# calculate daily increase of positive cases, averaged daily increase, and averaged daily growth rate by state
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(dailyPositives = c(NA, diff(positive)))
# calculate 5-day averaged new cases
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(avgDailyPositives =
(lag(dailyPositives, n = 2) +
lag(dailyPositives, n = 1) +
dailyPositives +
lead(dailyPositives, n = 1) +
lead(dailyPositives, n = 2)) / 5)
# calculate growth rate from 5-day averaged new cases
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(growthRate = avgDailyPositives/lag(avgDailyPositives))
# calculate percent change in 5-day averaged new cases
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(percentChange = 100 * avgDailyPositives / positive)
COVID_states <- COVID_states %>%
group_by(state) %>%
mutate(percentPositive = 100 * positiveIncrease / totalTestResultsIncrease)
```
WI
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r WItotal, echo=FALSE}
WI_total_plot <- COVID_states %>%
filter(state %in% "WI") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 20000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
WI_plotly_total <- ggplotly(p = (WI_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
WI_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r WIdaily, echo=FALSE}
# average new daily cases
WI_new_daily_plot <- COVID_states %>%
filter(state %in% "WI") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 300),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
WI_plotly_new_daily <- ggplotly(
p = (WI_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
WI_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r WIdailyGrowth, echo=FALSE}
WI_growth_rate_plot <- COVID_states %>%
filter(state %in% "WI") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 3.0, by = 0.5),
limits = c(0, 3.1),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
WI_growth_plotly <- ggplotly(
p = (WI_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
WI_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r WIpercentChange, echo=FALSE}
# average daily percent change
WI_daily_percent <- COVID_states %>%
filter(state %in% "WI") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
WIpercentPlotly <- ggplotly(
p = (
WI_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
WIpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r WIdailyTest, echo=FALSE}
WI_test_daily_plot <- COVID_states %>%
filter(state %in% "WI") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 10000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
WI_plotly_tests_daily <- ggplotly(
p = (WI_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
WI_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r WIpercentTest, echo=FALSE}
WI_test_percent <- COVID_states %>%
filter(state %in% "WI") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
WIpercentTestPlot <- ggplotly(
p = (
WI_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
WIpercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
MN
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r MNtotal, echo=FALSE}
MN_total_plot <- COVID_states %>%
filter(state %in% "MN") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 20000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
MN_plotly_total <- ggplotly(p = (MN_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MN_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r MNdaily, echo=FALSE}
# average new daily cases
MN_new_daily_plot <- COVID_states %>%
filter(state %in% "MN") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 410),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
MN_plotly_new_daily <- ggplotly(
p = (MN_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MN_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r MNdailyGrowth, echo=FALSE}
MN_growth_rate_plot <- COVID_states %>%
filter(state %in% "MN") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
MN_growth_plotly <- ggplotly(
p = (MN_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MN_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r MNpercentChange, echo=FALSE}
# average daily percent change
MN_daily_percent <- COVID_states %>%
filter(state %in% "MN") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
MNpercentPlotly <- ggplotly(
p = (
MN_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MNpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r MNdailyTest, echo=FALSE}
MN_test_daily_plot <- COVID_states %>%
filter(state %in% "MN") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 10000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
MN_plotly_tests_daily <- ggplotly(
p = (MN_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MN_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r MNpercentTest, echo=FALSE}
MN_test_percent <- COVID_states %>%
filter(state %in% "MN") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
MNpercentTestPlot <- ggplotly(
p = (
MN_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MNpercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
AL
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r ALtotal, echo=FALSE}
AL_total_plot <- COVID_states %>%
filter(state %in% "AL") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 20000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
AL_plotly_total <- ggplotly(p = (AL_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
AL_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r ALdaily, echo=FALSE}
# average new daily cases
AL_new_daily_plot <- COVID_states %>%
filter(state %in% "AL") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 330),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
AL_plotly_new_daily <- ggplotly(
p = (AL_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
AL_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r ALdailyGrowth, echo=FALSE}
AL_growth_rate_plot <- COVID_states %>%
filter(state %in% "AL") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
AL_growth_plotly <- ggplotly(
p = (AL_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
AL_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r ALpercentChange, echo=FALSE}
# average daily percent change
AL_daily_percent <- COVID_states %>%
filter(state %in% "AL") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
ALpercentPlotly <- ggplotly(
p = (
AL_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
ALpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r ALdailyTest, echo=FALSE}
AL_test_daily_plot <- COVID_states %>%
filter(state %in% "AL") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 10000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
AL_plotly_tests_daily <- ggplotly(
p = (AL_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
AL_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r ALpercentTest, echo=FALSE}
AL_test_percent <- COVID_states %>%
filter(state %in% "AL") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
ALpercentTestPlot <- ggplotly(
p = (
AL_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
ALpercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
GA
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r GAtotal, echo=FALSE}
GA_total_plot <- COVID_states %>%
filter(state %in% "GA") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 120000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
GA_plotly_total <- ggplotly(p = (GA_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
GA_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r GAdaily, echo=FALSE}
# average new daily cases
GA_new_daily_plot <- COVID_states %>%
filter(state %in% "GA") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 1500),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
GA_plotly_new_daily <- ggplotly(
p = (GA_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
GA_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r GAdailyGrowth, echo=FALSE}
GA_growth_rate_plot <- COVID_states %>%
filter(state %in% "GA") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
GA_growth_plotly <- ggplotly(
p = (GA_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
GA_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r GApercentChange, echo=FALSE}
# average daily percent change
GA_daily_percent <- COVID_states %>%
filter(state %in% "GA") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
GApercentPlotly <- ggplotly(
p = (
GA_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
GApercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r GAdailyTest, echo=FALSE}
GA_test_daily_plot <- COVID_states %>%
filter(state %in% "GA") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 10000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
GA_plotly_tests_daily <- ggplotly(
p = (GA_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
GA_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r GApercentTest, echo=FALSE}
GA_test_percent <- COVID_states %>%
filter(state %in% "GA") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
GApercentTestPlot <- ggplotly(
p = (
GA_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
GApercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
FL
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r FLtotal, echo=FALSE}
FL_total_plot <- COVID_states %>%
filter(state %in% "FL") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 110000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
FL_plotly_total <- ggplotly(p = (FL_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
FL_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r FLdaily, echo=FALSE}
# average new daily cases
FL_new_daily_plot <- COVID_states %>%
filter(state %in% "FL") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 2000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
FL_plotly_new_daily <- ggplotly(
p = (FL_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
FL_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r FLdailyGrowth, echo=FALSE}
FL_growth_rate_plot <- COVID_states %>%
filter(state %in% "FL") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
FL_growth_plotly <- ggplotly(
p = (FL_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
FL_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r FLpercentChange, echo=FALSE}
# average daily percent change
FL_daily_percent <- COVID_states %>%
filter(state %in% "FL") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
FLpercentPlotly <- ggplotly(
p = (
FL_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
FLpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r FLdailyTest, echo=FALSE}
FL_test_daily_plot <- COVID_states %>%
filter(state %in% "FL") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 20000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
FL_plotly_tests_daily <- ggplotly(
p = (FL_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
FL_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r FLpercentTest, echo=FALSE}
FL_test_percent <- COVID_states %>%
filter(state %in% "FL") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
FLpercentTestPlot <- ggplotly(
p = (
FL_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
FLpercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
MA
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r MAtotal, echo=FALSE}
MA_total_plot <- COVID_states %>%
filter(state %in% "MA") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 200000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
MA_plotly_total <- ggplotly(p = (MA_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MA_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r MAdaily, echo=FALSE}
# average new daily cases
MA_new_daily_plot <- COVID_states %>%
filter(state %in% "MA") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 2500),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
MA_plotly_new_daily <- ggplotly(
p = (MA_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MA_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r MAdailyGrowth, echo=FALSE}
MA_growth_rate_plot <- COVID_states %>%
filter(state %in% "MA") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
MA_growth_plotly <- ggplotly(
p = (MA_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
MA_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in New Cases
```{r MApercentChange, echo=FALSE}
# average daily percent change
MA_daily_percent <- COVID_states %>%
filter(state %in% "MA") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
MApercentPlotly <- ggplotly(
p = (
MA_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MApercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r MAdailyTest, echo=FALSE}
MA_test_daily_plot <- COVID_states %>%
filter(state %in% "MA") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 20000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
MA_plotly_tests_daily <- ggplotly(
p = (MA_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MA_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r MApercentTest, echo=FALSE}
MA_test_percent <- COVID_states %>%
filter(state %in% "MA") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
MApercentTestPlot <- ggplotly(
p = (
MA_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
MApercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
NY
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r NYtotal, echo=FALSE}
NY_total_plot <- COVID_states %>%
filter(state %in% "NY") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 7, base = 10),
limits = c(1, 1100000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
NY_plotly_total <- ggplotly(p = (NY_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NY_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r NYdaily, echo=FALSE}
# average new daily cases
NY_new_daily_plot <- COVID_states %>%
filter(state %in% "NY") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 15000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
NY_plotly_new_daily <- ggplotly(
p = (NY_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NY_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r NYdailyGrowth, echo=FALSE}
NY_growth_rate_plot <- COVID_states %>%
filter(state %in% "NY") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
NY_growth_plotly <- ggplotly(
p = (NY_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NY_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r NYpercentChange, echo=FALSE}
# average daily percent change
NY_daily_percent <- COVID_states %>%
filter(state %in% "NY") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
NYpercentPlotly <- ggplotly(
p = (
NY_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NYpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r NYdailyTest, echo=FALSE}
NY_test_daily_plot <- COVID_states %>%
filter(state %in% "NY") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 32000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
NY_plotly_tests_daily <- ggplotly(
p = (NY_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NY_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r NYpercentTest, echo=FALSE}
NY_test_percent <- COVID_states %>%
filter(state %in% "NY") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
NYpercentTestPlot <- ggplotly(
p = (
NY_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NYpercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.
NJ
==========================================
Row
---------------------------------------------------
### Cumulative Cases
```{r NJtotal, echo=FALSE}
NJ_total_plot <- COVID_states %>%
filter(state %in% "NJ") %>%
ggplot(aes(x = date, y = positive)) +
geom_line(color = "blue") +
scale_y_log10(breaks = log_breaks(n = 8, base = 10),
limits = c(1, 2000000),
labels = scales::comma_format(accuracy = 1),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
xlab("Date") +
ylab("Total Confirmed Cases")
NJ_plotly_total <- ggplotly(p = (NJ_total_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NJ_plotly_total
```
> Note that total cases are plotted on a log scale.
### New Daily Cases
```{r NJdaily, echo=FALSE}
# average new daily cases
NJ_new_daily_plot <- COVID_states %>%
filter(state %in% "NJ") %>%
ggplot(aes(x = date, y = avgDailyPositives)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 5300),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Daily New Cases")
NJ_plotly_new_daily <- ggplotly(
p = (NJ_new_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NJ_plotly_new_daily
```
> The 5-day rolling average is plotted.
Row
--------------------------------------------------
### Daily Growth Factor
```{r NJdailyGrowth, echo=FALSE}
NJ_growth_rate_plot <- COVID_states %>%
filter(state %in% "NJ") %>%
filter(growthRate < 100) %>%
ggplot(aes(x = date, y = growthRate)) +
geom_line(color = "blue") +
scale_x_date(date_breaks = "2 week",
minor_breaks = "1 day", date_labels = "%b %d") +
scale_y_continuous(breaks = seq(0, 2.5, by = 0.5),
limits = c(0, 2.6),
expand = c(0, 0)) +
xlab("Date") +
ylab("Daily Growth Factor")
NJ_growth_plotly <- ggplotly(
p = (NJ_growth_rate_plot + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray80"))))
NJ_growth_plotly
```
> This is the factor by which new cases multiply each day. A growth factor less than 1 indicates declining growth. A growth factor greater than 1 indicates increasing, and possibly exponential, growth. The 5-day rolling average is plotted.
### Percent Change in Cases
```{r NJpercentChange, echo=FALSE}
# average daily percent change
NJ_daily_percent <- COVID_states %>%
filter(state %in% "NJ") %>%
filter(positive > 10) %>%
ggplot(aes(x = date, y = percentChange)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(-25, 100),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Percent change in cases")
NJpercentPlotly <- ggplotly(
p = (
NJ_daily_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NJpercentPlotly
```
> Percent change is calculated as using the 5-day rolling average of daily new cases as a percent of total cases for that day. Only dates with more than 10 total cases are plotted.
Row
---------------------------------------------------
### Total Tests per Day
```{r NJdailyTest, echo=FALSE}
NJ_test_daily_plot <- COVID_states %>%
filter(state %in% "NJ") %>%
ggplot(aes(x = date, y = totalTestResultsIncrease)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma,
limits = c(0, 15000),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Total Daily Tests")
NJ_plotly_tests_daily <- ggplotly(
p = (NJ_test_daily_plot +
theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NJ_plotly_tests_daily
```
> Total reported COVID tests per day.
### Percentage of Daily Tests that are Positive
```{r NJpercentTest, echo=FALSE}
NJ_test_percent <- COVID_states %>%
filter(state %in% "NJ") %>%
ggplot(aes(x = date, y = percentPositive)) +
geom_line(color = "blue") +
scale_y_continuous(labels = comma, limits = c(0, 105),
expand = c(0, 0)) +
scale_x_date(date_breaks = "2 week", date_labels = "%b %d",
minor_breaks = "1 day") +
xlab("Date") +
ylab("Positive Test Rate (%)")
NJpercentTestPlot <- ggplotly(
p = (
NJ_test_percent + theme_classic(base_size = 15) +
theme(panel.grid.major.y = element_line(color = "gray85"))))
NJpercentTestPlot
```
> Positive test rate is the percentage of total reported tests each day that are positive.